<template>
  <div id="printCoverList">
    <div class="print-cover" v-for="(item, index) in list" :key="index">
      <div class="text-top">
        <div class="text-row">
          <div class="text-underline">{{ item.code || `&nbsp;` }}</div>
          <div class="text-label letter">档号</div>
        </div>
        <div class="text-row">
          <div class="text-underline">&nbsp;</div>
          <div class="text-label">档案馆号</div>
        </div>
      </div>
      <div class="text-bottom">
        <div class="text-row">
          <div class="text-underline">&nbsp;</div>
          <div class="text-label">立卷单位</div>
        </div>
        <div class="text-row">
          <div class="text-underline">{{ item.byDate || `&nbsp;` }}</div>
          <div class="text-label">起止日期</div>
        </div>
        <div class="text-row">
          <div class="text-underline">{{ filterRow(item.retentionPeriodDate, 'DMS_ARCHIVES_FILE_LIST_RETENTION_PERIOD_DATE') || `&nbsp;` }}</div>
          <div class="text-label">保管期限</div>
        </div>
        <div class="text-row">
          <div class="text-underline">{{ filterRow(item.secretLevel, 'SECRET_LEVEL') || `&nbsp;` }}</div>
          <div class="text-label letter">密级</div>
        </div>
      </div>
    </div>
  </div>
</template>
<script lang="ts" setup>
import { computed, reactive } from 'vue';
import { formInfoStore } from '@/store/modules/form';
interface Item {
  byDate: string;
  code: string;
  retentionPeriodDate: number;
  secretLevel: number;
}
const props = defineProps({
  list: {
    type: Array<Item>
  }
});
const dictionary = formInfoStore().getDictionary;
function filterRow(data, filterName) {
  return dictionary[filterName][data];
}
</script>
<style lang="less" scoped></style>
